package com.lastproject.ejb.dao;

import java.util.List;

import javax.ejb.Remote;

import com.lastproject.dto.BookDTO;

@Remote
public interface BookDAORemote {

	boolean create(boolean hasPermission, BookDTO bookDTO);

	boolean edit(boolean hasPermission, BookDTO bookDTO);

	boolean remove(boolean hasPermission, BookDTO bookDTO);

	BookDTO findById(Object id);

	List<BookDTO> getAll();

	List<BookDTO> getBooksNotInWaitingList(int id);

	/**
	 * returneaza lista cartilor la care userul nu e in lista de asteptare, nu
	 * sunt imprumutate de el si contin textul pe care s-a facut search
	 * 
	 * @param id
	 * @param text
	 * @return
	 */
	List<BookDTO> getBooksContainingTextAndNotInWaitingList(int id, String text);

	List<BookDTO> getBooksBorrowedByUser(int idUser);

	List<BookDTO> getBooksWithUserInWaitingList(int id);

	List<BookDTO> getBooksContainingText(String text);

	boolean removeBook(boolean permission, int bookId);
}
